package com.jumi.microservice.common.exception;

/**
 * @author ssk
 * @create 2020/7/25 17:11
 **/
public enum ExceptionEnum implements BusinessExceptionAssert {
    /**
     * 返回状态码集
     */
    FAIL(500, "获取数据失败"),
    FAIL_CATEGORY_RXIST(500, "订单分类名称已经存在！"),
    FAIL_SUPPLIER_RXIST(500, "该供应商名称已经存在！"),
    FAIL_CHANGE(500, "数据传递失败!"),
    FAIL_EXPORT(500, "数据导出失败!"),
    FAIL_UPLOAD_NAME_LENGTH_LIMIT(500, "上传失败,文件名超出限制!"),
    FAIL_UPLOAD_SIZE_LIMIT(500, "上传失败,文件大小超出限制!"),
    FAIL_UPLOAD_INVALID_EXTENSION(500, "上传失败,文件类型错误!"),
    FAIL_TO_WDT(500, "推送旺店通失败!"),

    FAIL_STOCK_NUM_IS_NOT_EMPTY(500, "出/入库数量不能为空"),
    FAIL_STOCK_NUM_NOT_MATCH(500, "出/入库总数不匹配"),
    FAIL_STOCK_DETAIL_LIST_IS_NOT_EMPTY(500, "出入库物料列表不能为空"),

    FAIL_OCCUPY_PARAM_NOT_EMPTY(500, "库存占用参数不能为空"),
    FAIL_STOCK_OCCUPY_MATERIAL_OCCUPY_NUM_NOT_ENOUGH(500, "物料库存占用数不足"),
    FAIL_STOCK_OCCUPY_GOODS_OCCUPY_NUM_NOT_ENOUGH(500, "产品库存占用数不足"),
    FAIL_STOCK_OCCUPY_RECORD_NOT_EXISTS(500, "占用记录不存在或已经释放"),
    FAIL_STOCK_OCCUPY_RECORD_EXISTS(500, "占用记录已存在"),
    FAIL_STOCK_OCCUPY_ORDER_RECORD_EXISTS(500, "订单占用记录已存在, 占用无需重复释放"),
    FAIL_STOCK_OCCUPY_RELEASE_NOT_ENOUGH(500, "释放库存不能大于总占用库存"),
    FAIL_STOCK_COMMODITY_RELEASE_LIST_NOT_EMPTY(500, "商城物料库存释放列表不能为空"),

    FAIL_STOCK_PARAM_INVALID(500, "参数不能为空"),
    FAIL_STOCK_GOODS_NOT_EXISTS(500, "商品库存记录不存在"),
    FAIL_STOCK_MATERIAL_NOT_EXISTS(500, "物料库存记录不存在"),
    FAIL_STOCK_AVAILABLE_STOCK_NOT_ENOUGH(500, "可用库存不足"),
    FAIL_STOCK_REAL_STOCK_NOT_ENOUGH(500, "入库库存不足"),

    FAIL_CONVERSION_DETAIL_IS_EMPTY(500, "调仓详情为空"),

    FAIL_APPLY_IS_ALREADY_CHECKED(500, "申请已经通过，无须重复审核")

    ;

    private final Integer code;

    private String message;

    ExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
